home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 November / Chip Kasım 2001.iso / prog / cdcode / vmware / setup.exe / data1.cab / WinNTInf / oemnadvm.inf
Encoding:
INI File  |  2001-09-19  |  27.9 KB  |  801 lines

  1. ;
  2. ; rcsId_oemnadvm = "$Id: oemnadvm.inf,v 1.1.1.1 2000/05/24 04:14:13 yoel Exp $";
  3. ;
  4. ; VMware VMnet NDIS driver installation file.
  5. ; Install NDIS adapter and associated DHCP service.
  6. ;
  7.  
  8. [Identification]
  9.    OptionType = NetAdapter
  10.  
  11. ;
  12. ; We are x86 hardware independent but have no way of
  13. ; saying that so just list the possible buses.
  14. ;
  15. [PlatformsSupported]
  16.    ISA
  17.    EISA
  18.    PCI
  19.    MCA
  20.  
  21. ;
  22. ; Our adapter types correspond to the possible VMnet
  23. ; hubs we can bind to.  This lets folks select additional
  24. ; adapters for custom networking configs by selecting
  25. ; from the "Add Adapters" list in the NCPA.
  26. ;
  27. [Options]
  28.    VMnet0
  29.    VMnet1
  30.    VMnet2
  31.    VMnet3
  32.    VMnet4
  33.    VMnet5
  34.    VMnet6
  35.    VMnet7
  36.    VMnet8
  37.    VMnet9
  38.  
  39. [FileConstants]
  40.    UtilityInf = "UTILITY.INF"
  41.    subroutineinf = "SUBROUTN.INF"
  42.    ProductSoftwareImagePath = "%SystemRoot%\System32\drivers\vmnetx.sys"
  43.    ProductSoftwareUpgradePath = "\SystemRoot\System32\drivers\vmnetx.sys"
  44.    Exit_Code = 0
  45.    NetworkCardsKey = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"
  46.  
  47.    Manufacturer = "VMware, Inc."
  48.    ProductSoftwareName = "VMnetx"
  49.    ProductSoftwareDependency = {"VMnet"}
  50.    SoftwareType = "driver"
  51.    NetRuleSoftwareType = "VMnetxSys ndisDriver VMnetxDriver"
  52.    NetRuleSoftwareUse = $(SoftwareType)
  53.    NetRuleSoftwareBindForm = """VMnetxSys"" yes no container"
  54.    NetRuleSoftwareClass = {"VMnetxDriver basic"}
  55.    NetRuleSoftwareBindable = {"VMnetxDriver VMnetxAdapter non exclusive 100"}
  56.    ProductHardwareName = "VMnetx"
  57.    NetRuleHardwareBindForm = " yes yes container"
  58.  
  59.    ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  60.  
  61.    FunctionTitle = "VMware Virtual Ethernet Adapter Setup"
  62.    ProductSoftwareDescription = "VMware Virtual Ethernet Adapter Driver"
  63.    ProductSoftwareTitle = "VMware Virtual Ethernet Adapter Driver"
  64.     ProductMajorVersion = "1"
  65.     ProductMinorVersion = "0"
  66.     ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
  67.  
  68.    NetRuleHardwareType = "VMnetx VMnetxAdapter"
  69.    NetRuleHardwareClass = {"VMnetxAdapter basic"}
  70.  
  71.    ProductHardwareTitle = "VMware Virtual Ethernet Adapter"
  72.    ProductHardwareDescription = "VMware Virtual Ethernet Adapter"
  73.  
  74.    DHCPSoftwareName            = "VMnetDHCP"
  75.    DHCPSoftwareTitle            = "VMware Host-Only DHCP Server"
  76.    DHCPSoftwareImagePath    = "%SystemRoot%\System32\vmnetdhcp.exe"
  77.    DHCPSoftwareDependency    = {"VMnet"}
  78.    DHCPSoftwareType            = "service"
  79.    DHCPSoftwareDescription    = "VMware Host-Only DHCP Service"
  80.     DHCPSoftwareDisplayName    = "VMnet DHCP Server"
  81.     DHCPSoftwareMajorVersion= "2"
  82.     DHCPSoftwareMinorVersion= "0"
  83.     DHCPSotftwareVersion        = $(DHCPSoftwareMajorVersion)"."$(DHCPSoftwareMinorVersion)
  84.    DHCPSoftwareKeyName        = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(DHCPSoftwareName)"\CurrentVersion"
  85.     DHCPSoftwareConfFile        = "%SystemRoot%\System32\vmnetdhcp.conf"
  86.     DHCPSoftwareLeaseFile    = "%SystemRoot%\System32\vmnetdhcp.leases"
  87.    VMwareDeleteKeyName        = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\VMware for Windows NT\UninstallFiles"
  88.  
  89. [GeneralConstants]
  90.    from = ""
  91.    to = ""
  92.    KeyNull = ""
  93.    RegistryErrorIndex = NO_ERROR
  94.    KeyProduct = ""
  95.    TRUE = 1
  96.    FALSE = 0
  97.    NoTitle = 0
  98.    OldVersionExisted = $(FALSE)
  99.    NT400VersionConstant = "(4.0)"
  100.  
  101. [date]
  102.    Now = {} ? $(!LIBHANDLE) GetSystemDate
  103.  
  104.  
  105. [Identify]
  106.    read-syms Identification
  107.    set Status = STATUS_SUCCESSFUL
  108.    set Identifier = $(OptionType)
  109.    set Media = #("Source Media Descriptions", 1, 1)
  110.    Return $(Status) $(Identifier) $(Media)
  111.  
  112. [ReturnOptions]
  113.    set Status = STATUS_FAILED
  114.    set OptionList = {}
  115.    set OptionTextList = {}
  116.    set LanguageList = ^(LanguagesSupported, 1)
  117.    Ifcontains(i) $($0) in $(LanguageList)
  118.       ifstr(i) $($1) == ""
  119.         goto returnoptions
  120.       endif
  121.       set PlatformList = ^(PlatformsSupported, 1)
  122.       Ifcontains(i) $($1) in $(PlatformList)
  123.      goto returnoptions
  124.       else
  125.      set Status = STATUS_NOTSUPPORTED
  126.      goto finish_ReturnOptions
  127.       endif
  128.    else
  129.       set Status = STATUS_NOLANGUAGE
  130.       goto finish_ReturnOptions
  131.    endif
  132.  
  133. returnoptions = +
  134.    set OptionList = ^(Options, 1)
  135.    set OptionTextList = ^(OptionsText$($0), 1)
  136.    set Status = STATUS_SUCCESSFUL
  137.  
  138. finish_ReturnOptions = +
  139.    Return $(Status) $(OptionList) $(OptionTextList)
  140.  
  141. ;
  142. ; Check for a previously installed VMnet NDIS adapter.  This is
  143. ; cribbed from IsNetCardAlreadyInstalled but differs in that we
  144. ; have no bus number and card slot to use in identifying adapters;
  145. ; instead we use the VMnet device we're bound to.
  146. ;
  147. [InitBaseVars]
  148.    MAXIMUM_ALLOWED    = 33554432
  149.    KeyNull            = ""
  150.    RegistryErrorIndex = NO_ERROR
  151.    CurrentControlSet  = "SYSTEM\CurrentControlSet"
  152.    ServicesBaseName   = $(CurrentControlSet)"\Services"
  153.    NetworkCardKeyName = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards"
  154. [IsVMNetCardAlreadyInstalled]
  155.    read-syms InitBaseVars
  156.    set AlreadyExisted  = "NO"
  157.    set VMnet = $($0)
  158.    set Description = $($1)
  159.    set Product = $($2)
  160.    set SkipDescriptionCheck = $($3)
  161.    ifstr(i) $(SkipDescriptionCheck) == ""
  162.       set SkipDescriptionCheck = "NO"
  163.    endif
  164.    OpenRegKey $(!REG_H_LOCAL) "" $(NetworkCardKeyName) $(MAXIMUM_ALLOWED) IE_KeyNetcards
  165.    Ifstr $(IE_KeyNetcards) == $(KeyNull)
  166.       Debug-Output "OEMNADVM.INF: OpenRegKey of "$(NetworkCardKeyName)" failed, RegLastError "$(RegLastError)
  167.       set RegistryErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
  168.       goto IE_Return
  169.    endif
  170.    EnumRegKey $(IE_KeyNetcards) IE_KeyNameList
  171.    ForListDo  $(IE_KeyNameList)
  172.         set IE_KeyName = *($($),1)
  173.         OpenRegKey $(IE_KeyNetcards) "" $(IE_KeyName) $(MAXIMUM_ALLOWED) IE_Card
  174.         Ifstr $(IE_Card) == $(KeyNull)
  175.            set RegistryErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
  176.            goto IE_Return
  177.         endif
  178.         GetRegValue $(IE_Card),"Description", DescriptionInfo
  179.         GetRegValue $(IE_Card),"ProductName", ProductNameInfo
  180.         set CardDescription     = *($(DescriptionInfo), 4)
  181.         set CardProductName     = *($(ProductNameInfo), 4)
  182.         ifstr(i) $(SkipDescriptionCheck) == "YES"
  183.             set CardDescription = $(Description)
  184.             set CardProductName = $(Product)
  185.         endif
  186.         ifstr(i) $(CardDescription) == $(Description)
  187.             ifstr(i) $(CardProductName) == $(Product)
  188.                 GetRegValue $(IE_Card), "ServiceName", ServiceNameInfo
  189.                 set ServiceName = *($(ServiceNameInfo), 4)
  190.                 OpenRegKey $(!REG_H_LOCAL) "" +
  191.                    $(ServicesBaseName)"\"$(ServiceName)"\Parameters" +
  192.                    $(MAXIMUM_ALLOWED) IE_KeyService
  193.                 Ifstr $(IE_KeyService) == $(KeyNull)
  194.                    set RegistryErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
  195.                    goto IE_Return
  196.                 endif
  197.                 GetRegValue $(IE_KeyService), "VMnet", VMnetInfo
  198.                 set CardVMnet = *($(VMnetInfo), 4)
  199.                 ifstr(i) $(CardVMnet) == $(VMnet)
  200.            set AlreadyExisted = "YES"
  201.                 endif
  202.             endif
  203.         endif
  204.    EndForListDo
  205. IE_Return = +
  206.    return $(RegistryErrorIndex) $(AlreadyExisted)
  207.  
  208. [InstallOption]
  209.    set CurrLang = $($0)
  210.    set Option = $($1)
  211.    set SrcDir = $($2)
  212.    set AddCopy = $($3)
  213.    set DoCopy = $($4)
  214.    set DoConfig = $($5)
  215.    set LanguageList = ^(LanguagesSupported, 1)
  216.    Ifcontains(i) $($0) NOT-IN $(LanguageList)
  217.       Return STATUS_NOLANGUAGE
  218.    endif
  219.    set-subst LF = "\n"
  220.    read-syms GeneralConstants
  221.    read-syms FileConstants
  222.    ifstr(i) $(!NTN_Origination) == "NCPA"
  223.       set Continue = "OK"
  224.    endif
  225.    detect date
  226.    set-title $(FunctionTitle)
  227.    set to = Begin
  228.    set from = Begin
  229.    set CommonStatus = STATUS_SUCCESSFUL
  230.    EndWait
  231.  
  232. Begin = +
  233. ;
  234. ; NB: the real work begins here...
  235. ;
  236.  
  237. ;
  238. ; Verify the platform is ok for installation.
  239. ;
  240. set CurrentVersionValue = ""
  241. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_SoftwareBase)"\Microsoft\Windows Nt\CurrentVersion" $(!REG_KEY_READ) KeyNt
  242. Ifstr(i) $(KeyNt) != ""
  243.   GetRegValue $(KeyNt) "CurrentVersion" CurrentVersionValue
  244.   CloseRegKey $(KeyNt)
  245. Endif
  246. ifstr(i) (*($(CurrentVersionValue),4)) == $(NT400VersionConstant)
  247.   set NDIS_VER = NDIS4
  248. else-ifstr(i) (*($(CurrentVersionValue),4)) == $(NT500VersionConstant)
  249.   set NDIS_VER = NDIS4
  250. else
  251.   set Error = "Your version of Windows NT is not supported by this product"
  252.   goto fatal
  253. endif
  254.  
  255. ;
  256. ; Identify what we need to do based on how we were invoked.
  257. ;
  258. Ifstr(i) $(!NTN_InstallMode) == deinstall
  259.    ;
  260.    ; Remove adapter and software component.
  261.    ;
  262.    Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer),+
  263.             $(ProductSoftwareName), $(!NTN_RegBase)
  264.    ifint $($ShellCode) != $(!SHELL_CODE_OK)
  265.         goto ShellCodeError
  266.    endif
  267.    set RegistryErrorIndex = $($R0)
  268.    Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  269.         goto fatalregistry
  270.    endif
  271.  
  272.    ;
  273.    ; Invoke external vnetprobe app to remove the reference to this
  274.    ; adapter in the dhcp config file and, possibly, remove the DHCP
  275.    ; service.
  276.    ;
  277.    RunProgram ExitCode "Windows Directory" "" "vnetprobe.exe" "-u" $(Option)
  278.  
  279.    goto end
  280. else-Ifstr(i) $(!NTN_InstallMode) == Update
  281.    ;
  282.    ; Update software component.
  283.    ;
  284.  
  285.    ; copy NDIS driver
  286.    install "Install-Option" 
  287.    ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  288.       Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  289.       ifint $($ShellCode) != $(!SHELL_CODE_OK)
  290.      goto ShellCodeError 
  291.       endif 
  292.       set Error = $($R0) 
  293.       goto fatal 
  294.    endif 
  295.  
  296.    OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(!REG_KEY_ALL_ACCESS) KeyProduct
  297.    Ifstr $(KeyProduct) != ""
  298.       Shell $(UtilityInf), GetInfFileNameFromRegistry, $(KeyProduct)
  299.       ifint $($ShellCode) != $(!SHELL_CODE_OK)
  300.      goto ShellCodeError
  301.       endif 
  302.       set !UG_Filename = $($R0) 
  303.       install "Install-INF" 
  304.       ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  305.      goto fatal 
  306.       endif 
  307.  
  308.       OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ProductHardwareName) $(!REG_KEY_ALL_ACCESS) KeyService
  309.       Ifstr $(KeyService) == ""
  310.      goto fatalregistry 
  311.       endif                           
  312.       SetRegValue $(KeyService) {ImagePath,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareUpgradePath)}
  313.       CloseRegKey $(KeyService)                                                                                                                                        
  314.  
  315.       OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase) $(!REG_KEY_ALL_ACCESS) KeyNt
  316.       set LoopList = {1,2,3,4,5,6,7,8} 
  317.       ForListDo $(LoopList) 
  318.      OpenRegKey $(KeyNt) "" $(ProductHardwareName)$($)"\Parameters" $(!REG_KEY_ALL_ACCESS) TestKey 
  319.      ifstr $(TestKey) != $(KeyNull) 
  320.         OpenRegKey $(!REG_H_LOCAL) "" $(NetworkCardsKey)$($)"\NetRules" $(!REG_KEY_ALL_ACCESS) NetCardKey 
  321.         ifstr $(NetCardKey) != $(KeyNull) 
  322.            SetRegValue $(NetCardKey) {"InfName",$(NoTitle),$(!REG_VT_SZ),$(!UG_Filename)} 
  323.            CloseRegKey $(NetCardKey) 
  324.         endif 
  325.         CloseRegKey $(TestKey) 
  326.      endif 
  327.       EndForListDo 
  328.    else
  329.       goto fatalregistry
  330.    endif
  331.    goto end
  332. else-Ifstr(i) $(!NTN_InstallMode) == bind
  333.   Shell "subroutn.inf" SetupMessage, $(!STF_LANGUAGE), STATUS, +
  334.          "Yo! Bind Adapter"
  335.   Return STATUS_SUCCESSFUL
  336. else-Ifstr(i) $(!NTN_InstallMode) == configure
  337.   Shell "subroutn.inf" SetupMessage, $(!STF_LANGUAGE), STATUS,+
  338.     "Sorry, no properties available just yet!"
  339.   Return STATUS_USERCANCEL
  340. else
  341.    ;
  342.    ; Install adapter.
  343.    ;
  344.    OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(!REG_KEY_READ) KeyProduct
  345.    Ifstr $(KeyProduct) != $(KeyNull)
  346.       CloseRegKey $(KeyProduct)
  347.       ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
  348.      ifint $($ShellCode) != $(!SHELL_CODE_OK)
  349.         goto ShellCodeError
  350.          endif
  351.          goto end
  352.       else
  353.      set OldVersionExisted = $(TRUE)
  354.       endif
  355.    endif
  356.  
  357.    StartWait
  358. ;   ifint $(OldVersionExisted) == $(FALSE)
  359.       ;
  360.       ; No previously installed version; install the driver
  361.       ; and .inf file as needed.
  362.       ;
  363. ;      Ifstr(i) $(DoCopy) == "YES"
  364. ;     Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) NO
  365. ;     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  366. ;        Goto ShellCodeError
  367. ;     Else-Ifstr(i) $($R0) == STATUS_FAILED
  368. ;        Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  369. ;        ifint $($ShellCode) != $(!SHELL_CODE_OK)
  370. ;           goto ShellCodeError
  371. ;        endif
  372. ;        set Error = $($R0)
  373. ;        Goto fatal
  374. ;     Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  375. ;        Goto end
  376. ;     Endif
  377. ;      Endif
  378. ;      install "Install-Option"
  379. ;      ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  380. ;     Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  381. ;     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  382. ;        goto ShellCodeError
  383. ;     endif
  384. ;     set Error = $($R0)
  385. ;     goto fatal
  386. ;      endif
  387. ;   endif
  388.  
  389.    ;
  390.    ; Check if the software component is already setup in the registry.
  391.    ;
  392.    OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ProductHardwareName) $(!REG_KEY_READ) KeyNt
  393.    CloseRegKey $(KeyNt)
  394.    Ifstr(i) $(KeyNt) == ""
  395.       Debug-Output "OEMNADVM.INF: Software component $(ProductHardwareName) not present, add"
  396.  
  397.       ;
  398.       ; NB: Cannot specify needed dependency through this 
  399.       ;     interface; we do it instead below.
  400.       ;
  401.       Shell $(UtilityInf), AddSoftwareComponent,+
  402.         $(Manufacturer),+
  403.         $(ProductSoftwareName),+
  404.           $(ProductSoftwareName),+
  405.         $(ProductSoftwareTitle),+
  406.           $(STF_CONTEXTINFNAME),+
  407.         $(ProductSoftwareImagePath),+
  408.           "kernel",+
  409.           "NDIS",+
  410.           {},+
  411.           ""
  412.       ifint $($ShellCode) != $(!SHELL_CODE_OK)
  413.             goto ShellCodeError
  414.       endif
  415.  
  416.       set RegistryErrorIndex = $($R0)
  417.       Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  418.          EndWait
  419.          CloseRegKey $($R1)
  420.          CloseRegKey $($R2)
  421.          CloseRegKey $($R3)
  422.          CloseRegKey $($R4)
  423.          CloseRegKey $($R5)
  424.          goto fatalregistry
  425.       endif
  426.       Set SoftProductKey = $($R1)
  427.       Set SoftNetRuleKey = $($R2)
  428.       Set SoftServiceKey = $($R3)
  429.       Set SoftParameterKey = $($R4)
  430.       Set SoftLinkageKey = $($R5)
  431.  
  432.       set NewValueList = {+
  433.          {SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  434.          {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  435.          {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  436.          {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  437.             {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  438.          {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  439.          {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}+
  440.       }
  441.       Shell $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
  442.       ifint $($ShellCode) != $(!SHELL_CODE_OK)
  443.             goto ShellCodeError
  444.       endif
  445.       set RegistryErrorIndex = $($R0)
  446.       Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  447.          EndWait
  448.          CloseRegKey $(SoftProductKey)
  449.          CloseRegKey $(SoftNetRuleKey)
  450.          CloseRegKey $(SoftServiceKey)
  451.          CloseRegKey $(SoftParameterKey)
  452.          CloseRegKey $(SoftLinkageKey)
  453.          goto fatalregistry
  454.       endif
  455.  
  456.       set NewValueList = {+
  457.             {OtherDependencies,$(NoTitle),$(!REG_VT_MULTI_SZ),$(ProductSoftwareDependency)},+
  458.       }
  459.       Shell $(UtilityInf), AddValueList, $(SoftLinkageKey), $(NewValueList)
  460.       ifint $($ShellCode) != $(!SHELL_CODE_OK)
  461.             goto ShellCodeError
  462.       endif
  463.       set RegistryErrorIndex = $($R0)
  464.       Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  465.          EndWait
  466.          CloseRegKey $(SoftProductKey)
  467.          CloseRegKey $(SoftNetRuleKey)
  468.          CloseRegKey $(SoftServiceKey)
  469.          CloseRegKey $(SoftParameterKey)
  470.          CloseRegKey $(SoftLinkageKey)
  471.          goto fatalregistry
  472.       endif
  473.  
  474.       set NewValueList = {+
  475.          {type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  476.             {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  477.             {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  478.          {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  479.             {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  480.             {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}+
  481.       }
  482.       Shell $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
  483.       ifint $($ShellCode) != $(!SHELL_CODE_OK)
  484.          goto ShellCodeError
  485.       endif
  486.       set RegistryErrorIndex = $($R0)
  487.       CloseRegKey $(SoftProductKey)
  488.       CloseRegKey $(SoftNetRuleKey)
  489.       CloseRegKey $(SoftServiceKey)
  490.       CloseRegKey $(SoftParameterKey)
  491.       CloseRegKey $(SoftLinkageKey)
  492.       Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  493.         EndWait
  494.         goto fatalregistry
  495.       endif
  496.    else
  497.       Debug-Output "OEMNADVM.INF: Software component $(ProductHardwareName) already present"
  498.    endif
  499.  
  500.    ;
  501.    ; Check if the DHCP service is already setup in the registry.
  502.    ;
  503.    OpenRegKey $(!REG_H_LOCAL) "" $(DHCPSoftwareKeyName) $(!REG_KEY_ALL_ACCESS) KeyService
  504.    Ifstr(i) $(KeyService) == $(KeyNull)
  505.        Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  506.            $(DHCPSoftwareName), +
  507.            $(DHCPSoftwareName), +
  508.            $(DHCPSoftwareDisplayName), +
  509.            $(STF_CONTEXTINFNAME),+
  510.            $(DHCPSoftwareImagePath), +
  511.            "serviceauto",+
  512.            "",+
  513.            {"VMnet"},+
  514.               "",+
  515.            $(DHCPSoftwareImagePath),+
  516.               7,+
  517.               "Application"
  518.        ifint $($ShellCode) != $(!SHELL_CODE_OK)
  519.            Debug-Output "OEMNADVM.INF: InstallVMnetDHCPService : ShellCode error"
  520.            return STATUS_FAILED
  521.        endif
  522.        set RegistryErrorIndex = $($R0)
  523.        set ProductKey = $($R1)
  524.        set RuleKey = $($R2)
  525.        CloseRegKey $($R3)
  526.        set ParameterKey = $($R4)
  527.        CloseRegKey $($R5)
  528.  
  529.        set NewValueList = {+
  530.             {SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(DHCPSoftwareType)},+
  531.             {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(DHCPSoftwareMajorVersion)},+
  532.             {Title,$(NoTitle),$(!REG_VT_SZ),$(DHCPSoftwareTitle)},+
  533.             {Description,$(NoTitle),$(!REG_VT_SZ),$(DHCPSoftwareDescription)},+
  534.             {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(DHCPSoftwareMinorVersion)},+
  535.             {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}+
  536.        }
  537.        Shell  $(UtilityInf), AddValueList, $(ProductKey), $(NewValueList)
  538.        CloseRegKey $(ProductKey)
  539.        ifint $($ShellCode) != $(!SHELL_CODE_OK)
  540.            Debug-Output "OEMNADVM.INF: ShellCode error. Cannot add keys to VMnetDHCP"
  541.            goto ShellCodeError
  542.        endif
  543.        set RegistryErrorIndex = $($R0)
  544.        Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  545.            EndWait
  546.            Debug-Output "OEMNADVM.INF: InstallVMnetDHCPService: Registry error: product key" 
  547.            set Status = STATUS_FAILED
  548.        endif
  549.  
  550.        set NewValueList = {+
  551.             {InfOption,$(NoTitle),$(!REG_VT_SZ),"VMnetDHCP"}+
  552.          }
  553.        Shell  $(UtilityInf), AddValueList, $(RuleKey), $(NewValueList)
  554.        CloseRegKey $(RuleKey)
  555.        ifint $($ShellCode) != $(!SHELL_CODE_OK)
  556.            Debug-Output "OEMNADVM.INF: ShellCode error. Cannot add keys to VMnetDHCP rules"
  557.            goto ShellCodeError
  558.        endif
  559.        set RegistryErrorIndex = $($R0)
  560.        Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  561.            EndWait
  562.            Debug-Output "OEMNADVM.INF: InstallVMnetDHCPService: Registry error: rule key" 
  563.            set Status = STATUS_FAILED
  564.        endif
  565.  
  566.        set NewValueList = {+
  567.             {ConfFile,$(NoTitle),$(!REG_VT_EXPAND_SZ),$(DHCPSoftwareConfFile)},+
  568.             {LeaseFile,$(NoTitle),$(!REG_VT_EXPAND_SZ),$(DHCPSoftwareLeaseFile)}+
  569.          }
  570.        Shell  $(UtilityInf), AddValueList, $(ParameterKey), $(NewValueList)
  571.        CloseRegKey $(ParameterKey)
  572.        ifint $($ShellCode) != $(!SHELL_CODE_OK)
  573.            Debug-Output "OEMNADVM.INF: ShellCode error. Cannot add keys to VMnetDHCP parameters"
  574.            goto ShellCodeError
  575.        endif
  576.        set RegistryErrorIndex = $($R0)
  577.        Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  578.            EndWait
  579.            Debug-Output "OEMNADVM.INF: InstallVMnetDHCPService: Registry error: parameter key" 
  580.            set Status = STATUS_FAILED
  581.        endif
  582.  
  583.        OpenRegKey $(!REG_H_LOCAL) "" $(VMwareDeleteKeyName) $(!REG_KEY_ALL_ACCESS) DeleteFilesKey
  584.        Ifstr(i) $(DeleteFilesKey) == $(KeyNull)
  585.              CreateRegKey $(!REG_H_LOCAL) {$(VMwareDeleteKeyName),0,GenericClass} "" +
  586.               $(!REG_KEY_ALL_ACCESS) "" DeleteFilesKey
  587.          endif
  588.        Ifstr(i) $(DeleteFilesKey) != $(KeyNull)
  589.             set NewValueList = {+
  590.                 {$(DHCPSoftwareConfFile),$(NoTitle),$(!REG_VT_DWORD),0},+
  591.                 {$(DHCPSoftwareLeaseFile),$(NoTitle),$(!REG_VT_DWORD),0}+
  592.              }
  593.              Shell  $(UtilityInf), AddValueList, $(DeleteFilesKey), $(NewValueList)
  594.              CloseRegKey $(DeleteFilesKey)
  595.              ifint $($ShellCode) != $(!SHELL_CODE_OK)
  596.                  Debug-Output "OEMNADVM.INF: ShellCode error. Cannot add VMnet DHCP config files to delete list"
  597.                  goto ShellCodeError
  598.           endif
  599.           set RegistryErrorIndex = $($R0)
  600.           Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  601.              EndWait
  602.              Debug-Output "OEMNADVM.INF: InstallVMnetDHCPService: Registry error: delete files key" 
  603.              set Status = STATUS_FAILED
  604.           endif
  605.          else
  606.             Debug-Output "OEMNADVM.INF: Could not/create open "$(VMwareDeleteKeyName)" key, RegLastError "$(RegLastError)
  607.          endif
  608.     else
  609.         Debug-Output "OEMNADVM.INF: VMnetDHCP service already present"
  610.    endif
  611.    Ifstr(i) $(KeyService) != $(KeyNull)
  612.        CloseRegKey $(KeyService)
  613.    endif
  614.    EndWait
  615.  
  616.    ;
  617.    ; Check if the adapter is already setup in the registry.
  618.    ;
  619.    Shell "", IsVMNetCardAlreadyInstalled, "\DosDevices\"$(Option),+
  620.       $(ProductHardwareDescription), $(ProductHardwareName)
  621.    ifint $($ShellCode) != $(!SHELL_CODE_OK)
  622.       goto ShellCodeError
  623.    endif
  624.    Debug-Output "OEMNADVM.INF: IsVMNetCardAlreadyInstalled returns $($R0), $($R1)"
  625.    ifstr $($R0) != "NO_ERROR"
  626.       set Error = $($R0)
  627.       goto fatal
  628.    endif
  629.    ifstr(i) $($R1) == "NO"
  630.       Debug-Output "OEMNADVM.INF: Adapter not present, install"
  631.       ;
  632.       ; Adapter was not installed; do the "hardware" part of the install
  633.       ;
  634.       Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),+
  635.             $(STF_CONTEXTINFNAME),$(ProductKeyName)
  636.       ifint $($ShellCode) != $(!SHELL_CODE_OK)
  637.          goto ShellCodeError
  638.       endif
  639.       set RegistryErrorIndex = $($R0)
  640.       Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  641.          EndWait
  642.          CloseRegKey $($R1)
  643.          CloseRegKey $($R2)
  644.          CloseRegKey $($R3)
  645.          goto fatalregistry
  646.       endif
  647.       set HardNetCardKey = $($R1)
  648.       set HardNetRuleKey = $($R2)
  649.       set HardParameterKey = $($R3)
  650.       set AdapterNumber = $($R4)      ; allocated adapter number
  651.  
  652.       ;
  653.       ; Setup miscellaneous stuff.
  654.       ;
  655.       set NewValueList = {+
  656.          {Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  657.          {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardwareTitle)" ("$(Option)")"},+
  658.          {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareDescription)},+
  659.          {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  660.          {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  661.          {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}+
  662.       }
  663.       Shell $(UtilityInf), AddValueList, $(HardNetCardKey), $(NewValueList)
  664.       ifint $($ShellCode) != $(!SHELL_CODE_OK)
  665.          goto ShellCodeError
  666.       endif
  667.  
  668.       ;
  669.       ; Mark adapter as supporting Ethernet media
  670.       ; and setup binding to corresponding VMnet device.
  671.       ;
  672.       Set NewValueList = {+
  673.          {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
  674.             {VMnet,$(NoTitle),$(!REG_VT_SZ),"\DosDevices\"$(Option)},+
  675.       }
  676.       Shell $(UtilityInf), AddValueList, $(HardParameterKey), $(NewValueList)
  677.       ifint $($ShellCode) != $(!SHELL_CODE_OK)
  678.          goto ShellCodeError
  679.       endif
  680.  
  681.       ;
  682.       ; Invoke external vnetprobe app to probe for an available
  683.       ; Private IP address.  The user can override this later;
  684.       ; otherwise they'll be prompted during the binding process
  685.       ; and (probably) be confused.
  686.       ;
  687.       RunProgram ExitCode "Windows Directory" "" "vnetprobe.exe" "-i" $(Option)
  688.  
  689.       ;
  690.       ; Setup hardware-related binding rules.
  691.       ;
  692.       set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  693.       set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  694.       set NewValueList = {+
  695.             {type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  696.             {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  697.             {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  698.             {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}+
  699.       }
  700.       Shell $(UtilityInf), AddValueList, $(HardNetRuleKey), $(NewValueList)
  701.       ifint $($ShellCode) != $(!SHELL_CODE_OK)
  702.          goto ShellCodeError
  703.       endif
  704.       CloseRegKey $(HardNetCardKey)
  705.       CloseRegKey $(HardNetRuleKey)
  706.       CloseRegKey $(HardParameterKey)
  707.  
  708.       EndWait
  709.  
  710.       return STATUS_SUCCESSFUL                                                                                                                                   
  711.    else
  712.       Debug-Output "OEMNADVM.INF: Adapter already present, complain"
  713.       set Error = "The "$(Option)" adapter is already installed!"
  714.       Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), STATUS, $(Error)
  715.       ifint $($ShellCode) != $(!SHELL_CODE_OK)
  716.             goto ShellCodeError
  717.       endif
  718.       return STATUS_USRCANCEL
  719.    endif
  720. endif
  721.  
  722. fatalregistry = +
  723.    Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  724.    ifint $($ShellCode) != $(!SHELL_CODE_OK)
  725.       goto ShellCodeError
  726.    endif
  727.    set Error = $($R0)
  728.    goto fatal
  729.  
  730. fatal = +
  731.    ifstr(i) $(Error) == ""
  732.       Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  733.       ifint $($ShellCode) != $(!SHELL_CODE_OK)
  734.             goto ShellCodeError
  735.       endif
  736.       set Error = $($R0)
  737.    endif
  738.    Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  739.    ifint $($ShellCode) != $(!SHELL_CODE_OK)
  740.       goto ShellCodeError
  741.    endif
  742.    goto setfailed
  743.  
  744. ShellCodeError = +
  745.    set DlgType = "MessageBox"
  746.    set STF_MB_TITLE = $(ShellCodeErrorTitle)
  747.    set STF_MB_TEXT = $(ShellCodeErrorText) 
  748.    set STF_MB_TYPE = 1
  749.    set STF_MB_ICON = 3
  750.    set STF_MB_DEF = 1
  751.    ui start "Error Message"
  752.    goto setfailed
  753.  
  754. setfailed = +
  755.    set CommonStatus = STATUS_FAILED
  756.    goto end
  757.  
  758. end = +
  759.    Return $(CommonStatus)
  760.  
  761.  
  762. [Install-Option]
  763.    set STF_VITAL = ""
  764.    set STF_OVERWRITE = "VERIFYSOURCEOLDER"
  765.    AddSectionFilesToCopyList Files-$(NDIS_VER) $(SrcDir)WIN32\$(!STF_PLATFORM) $(!STF_WINDOWSSYSPATH)\drivers
  766.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  767.    CopyFilesInCopyList
  768.    Exit
  769.  
  770. [Install-INF]
  771.    set STF_VITAL = ""
  772.    AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
  773.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  774.    CopyFilesInCopyList
  775.    Exit
  776.  
  777. [Source Media Descriptions]
  778.    1 = "Windows NT Setup Disk #1" 
  779.    2 = "VMware for Windows NT Installation Disk", TAGFILE = DISK1
  780.  
  781. [Files-NDIS4]
  782.    3,vmnetx.sys, SIZE=25001
  783.  
  784. [ProductType]
  785.    STF_PRODUCT = Winnt
  786.  
  787. [LanguagesSupported]
  788.    ENG
  789.  
  790. [OptionsTextENG]
  791.    VMnet0 = "VMware Virtual Ethernet Adapter (for host-only support on VMnet0)"
  792.    VMnet1 = "VMware Virtual Ethernet Adapter (for basic host-only support)"
  793.    VMnet2 = "VMware Virtual Ethernet Adapter (for host-only support on VMnet2)"
  794.    VMnet3 = "VMware Virtual Ethernet Adapter (for host-only support on VMnet3)"
  795.    VMnet4 = "VMware Virtual Ethernet Adapter (for host-only support on VMnet4)"
  796.    VMnet5 = "VMware Virtual Ethernet Adapter (for host-only support on VMnet5)"
  797.    VMnet6 = "VMware Virtual Ethernet Adapter (for host-only support on VMnet6)"
  798.    VMnet7 = "VMware Virtual Ethernet Adapter (for host-only support on VMnet7)"
  799.    VMnet8 = "VMware Virtual Ethernet Adapter (for host-only support on VMnet8)"
  800.    VMnet9 = "VMware Virtual Ethernet Adapter (for host-only support on VMnet9)"
  801.